//
// Created by 高联锐 on 2021/2/18.
//
#include <stdio.h>
#include <string.h>
#define DENSITY 62.4 // density [ˈdensəti] 密度
int main(){
    printf("%s", "chapter04.c run...");
    float weight,volume; // volume [ˈvɒljuːm] 体积
    int size,letters;
    char name[40];
    printf("Hi! what's your first name?\n");
    scanf("%s", name);
    printf("%s,what's your weight in pounds [paʊndz] 镑 *1kg = 2.2046226pounds*?\n", name);
    scanf("%f", &weight);
    size = sizeof name;
    letters = strlen(name);
    volume = weight/DENSITY;
    printf("Well, %s your volume is %2.2f cubic feet [ˈkjuːbɪk fiːt] 立方英尺 \n",name,volume);
    printf("Also,your first name has %d letters \n", letters);


    printf("给定长度为4的char数组\n");
    char len[4];
    scanf("%s", len);
    printf("%s %lu \n", len,strlen(len));

    printf("输入两个浮点数，空格分隔\n");
    float f1,f2;
    scanf("%f%f", &f1, &f2);
    printf("%.1f,%.1f\n", f1, f2);


    return 0;
};

